package com.wngbms.feigndemo.controller;

import com.wngbms.feigndemo.feign.CaseFeign;
import com.wngbms.feigndemo.vo.BaseResp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@Slf4j
@RestController
public class CaseFeignController implements CaseFeign {

    @PostMapping("/mapJson")
    public String mapJson(@RequestBody Map<String, Object> jsonMap) {
        log.info("req:{}", jsonMap);
        return "success";
    }

    @Override
    public BaseResp formData1(String name, String password) {
        log.info("{}:{}", name, password);
        return BaseResp.success();
    }

    @Override
    public BaseResp formData2(MultipartFile file) {
        log.info("fileName:{}", file.getOriginalFilename());
        return BaseResp.success();
    }

    @Override
    public BaseResp formData3(String name, MultipartFile file) {
        log.info("userName:{}, fileName:{}", name, file.getOriginalFilename());
        return BaseResp.success();
    }

    @Override
    public BaseResp formData4(String name, String password) {
        log.info("{}:{}", name, password);
        return BaseResp.success();
    }

    @Override
    public BaseResp formData5(String name, String password) {
        log.info("{}:{}", name, password);
        return BaseResp.success();
    }

    @Override
    public BaseResp formData6(String body) {
        log.info("body:{}", body);
        return BaseResp.success();
    }

    @Override
    public BaseResp formData7(String body) {
        log.info("body:{}", body);
        return BaseResp.success();
    }

    @Override
    public BaseResp formData8(String body) {
        log.info("body:{}", body);
        return BaseResp.success();
    }

    @Override
    public BaseResp formData9(String body) {
        log.info("body:{}", body);
        return BaseResp.success();
    }

    @Override
    public BaseResp formData10(String body) {
        log.info("body:{}", body);
        return BaseResp.success();
    }
}
